/**
 * @fileOverview
 * todo 这文件干嘛使的
 * @author iNahoo
 * @since 2017/12/15.
 */
"use strict";

const Koa = require('koa');

const app = new Koa();

const data = [
    {
        "banner":"https://ws1.sinaimg.cn/large/b23aab69ly1fpjnjr9cgij20go0bkjyu.jpg",
        "title": "Design is a journey of",
        "highlight": "Discovery",
        "author":"William Hernandez.",
        "creatTime":"April 05 ,2017",
        "likes":400,
        "views":12,
        "comments":275,
    },
    {
        "banner":"https://ws1.sinaimg.cn/large/b23aab69ly1fpjnkvk92tj20zz1ecx6p.jpg",
        "title": "Design is a journey of1",
        "highlight": "Discovery2",
        "author":"William1 Hernandez.",
        "creatTime":"April 21 ,2017",
        "likes":400,
        "views":12,
        "comments":275,
    },
    {
        "banner":"https://ws1.sinaimg.cn/large/b23aab69ly1fpjnkscfgsj20rs0lsqn6.jpg",
        "title": "Design is a journey of",
        "highlight": "Discovery",
        "author":"William Hernandez.",
        "creatTime":"April 05 ,2017",
        "likes":400,
        "views":12,
        "comments":275,
    },
    {
        "banner":"https://ws1.sinaimg.cn/large/b23aab69ly1fpjnkr83cnj20jg0jgtfu.jpg",
        "title": "Design is a journey of",
        "highlight": "Discovery",
        "author":"William Hernandez.",
        "creatTime":"April 05 ,2017",
        "likes":400,
        "views":12,
        "comments":275,
    },
    {
        "banner":"https://ws1.sinaimg.cn/large/b23aab69ly1fpjnjr9cgij20go0bkjyu.jpg",
        "title": "Design is a journey of",
        "highlight": "Discovery",
        "author":"William Hernandez.",
        "creatTime":"April 05 ,2017",
        "likes":400,
        "views":12,
        "comments":275,
    },
];

app.use(async ctx=>{

    await wait();

    ctx.response.set('Access-Control-Allow-Origin','*');
    ctx.response.body = JSON.stringify(data);
});

function  wait(){
    return new Promise((res)=>{
        setTimeout(res,100);
})
}

app.listen(43765);